\(\int \frac {1+x^2}{1+3 x^2+x^4} \, dx\) [71]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 49 \[ \int \frac {1+x^2}{1+3 x^2+x^4} \, dx=\frac {\arctan \left (\sqrt {\frac {2}{3+\sqrt {5}}} x\right )}{\sqrt {5}}+\frac {\arctan \left (\sqrt {\frac {1}{2} \left (3+\sqrt {5}\right )} x\right )}{\sqrt {5}} \]

[Out]

1/5*arctan(x*2^(1/2)/(3+5^(1/2))^(1/2))*5^(1/2)+1/5*arctan(x*(1/2+1/2*5^(1/2)))*5^(1/2)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {1177, 209} \[ \int \frac {1+x^2}{1+3 x^2+x^4} \, dx=\frac {\arctan \left (\sqrt {\frac {2}{3+\sqrt {5}}} x\right )}{\sqrt {5}}+\frac {\arctan \left (\sqrt {\frac {1}{2} \left (3+\sqrt {5}\right )} x\right )}{\sqrt {5}} \]

[In]

Int[(1 + x^2)/(1 + 3*x^2 + x^4),x]

[Out]

ArcTan[Sqrt[2/(3 + Sqrt[5])]*x]/Sqrt[5] + ArcTan[Sqrt[(3 + Sqrt[5])/2]*x]/Sqrt[5]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 1177

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Di
st[e/2 + (2*c*d - b*e)/(2*q), Int[1/(b/2 - q/2 + c*x^2), x], x] + Dist[e/2 - (2*c*d - b*e)/(2*q), Int[1/(b/2 +
 q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[c*d^2 - a*e^2, 0] && GtQ[b^2
 - 4*a*c, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{10} \left (5-\sqrt {5}\right ) \int \frac {1}{\frac {3}{2}-\frac {\sqrt {5}}{2}+x^2} \, dx+\frac {1}{10} \left (5+\sqrt {5}\right ) \int \frac {1}{\frac {3}{2}+\frac {\sqrt {5}}{2}+x^2} \, dx \\ & = \frac {\tan ^{-1}\left (\sqrt {\frac {2}{3+\sqrt {5}}} x\right )}{\sqrt {5}}+\frac {\tan ^{-1}\left (\sqrt {\frac {1}{2} \left (3+\sqrt {5}\right )} x\right )}{\sqrt {5}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.69 \[ \int \frac {1+x^2}{1+3 x^2+x^4} \, dx=\frac {\left (-1+\sqrt {5}\right ) \arctan \left (\sqrt {\frac {2}{3-\sqrt {5}}} x\right )}{\sqrt {10 \left (3-\sqrt {5}\right )}}+\frac {\left (1+\sqrt {5}\right ) \arctan \left (\sqrt {\frac {2}{3+\sqrt {5}}} x\right )}{\sqrt {10 \left (3+\sqrt {5}\right )}} \]

[In]

Integrate[(1 + x^2)/(1 + 3*x^2 + x^4),x]

[Out]

((-1 + Sqrt[5])*ArcTan[Sqrt[2/(3 - Sqrt[5])]*x])/Sqrt[10*(3 - Sqrt[5])] + ((1 + Sqrt[5])*ArcTan[Sqrt[2/(3 + Sq
rt[5])]*x])/Sqrt[10*(3 + Sqrt[5])]

Maple [A] (verified)

Time = 0.09 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.71

method result size
risch \(\frac {\arctan \left (\frac {x \sqrt {5}}{5}\right ) \sqrt {5}}{5}+\frac {\sqrt {5}\, \arctan \left (\frac {x^{3} \sqrt {5}}{5}+\frac {4 x \sqrt {5}}{5}\right )}{5}\) \(35\)
default \(\frac {2 \left (\sqrt {5}-1\right ) \sqrt {5}\, \arctan \left (\frac {4 x}{2 \sqrt {5}-2}\right )}{5 \left (2 \sqrt {5}-2\right )}+\frac {2 \left (\sqrt {5}+1\right ) \sqrt {5}\, \arctan \left (\frac {4 x}{2 \sqrt {5}+2}\right )}{5 \left (2 \sqrt {5}+2\right )}\) \(66\)

[In]

int((x^2+1)/(x^4+3*x^2+1),x,method=_RETURNVERBOSE)

[Out]

1/5*arctan(1/5*x*5^(1/2))*5^(1/2)+1/5*5^(1/2)*arctan(1/5*x^3*5^(1/2)+4/5*x*5^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.63 \[ \int \frac {1+x^2}{1+3 x^2+x^4} \, dx=\frac {1}{5} \, \sqrt {5} \arctan \left (\frac {1}{5} \, \sqrt {5} {\left (x^{3} + 4 \, x\right )}\right ) + \frac {1}{5} \, \sqrt {5} \arctan \left (\frac {1}{5} \, \sqrt {5} x\right ) \]

[In]

integrate((x^2+1)/(x^4+3*x^2+1),x, algorithm="fricas")

[Out]

1/5*sqrt(5)*arctan(1/5*sqrt(5)*(x^3 + 4*x)) + 1/5*sqrt(5)*arctan(1/5*sqrt(5)*x)

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.84 \[ \int \frac {1+x^2}{1+3 x^2+x^4} \, dx=\frac {\sqrt {5} \cdot \left (2 \operatorname {atan}{\left (\frac {\sqrt {5} x}{5} \right )} + 2 \operatorname {atan}{\left (\frac {\sqrt {5} x^{3}}{5} + \frac {4 \sqrt {5} x}{5} \right )}\right )}{10} \]

[In]

integrate((x**2+1)/(x**4+3*x**2+1),x)

[Out]

sqrt(5)*(2*atan(sqrt(5)*x/5) + 2*atan(sqrt(5)*x**3/5 + 4*sqrt(5)*x/5))/10

Maxima [F]

\[ \int \frac {1+x^2}{1+3 x^2+x^4} \, dx=\int { \frac {x^{2} + 1}{x^{4} + 3 \, x^{2} + 1} \,d x } \]

[In]

integrate((x^2+1)/(x^4+3*x^2+1),x, algorithm="maxima")

[Out]

integrate((x^2 + 1)/(x^4 + 3*x^2 + 1), x)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.53 \[ \int \frac {1+x^2}{1+3 x^2+x^4} \, dx=\frac {1}{10} \, \sqrt {5} {\left (\pi \mathrm {sgn}\left (x\right ) + 2 \, \arctan \left (\frac {\sqrt {5} {\left (x^{2} - 1\right )}}{5 \, x}\right )\right )} \]

[In]

integrate((x^2+1)/(x^4+3*x^2+1),x, algorithm="giac")

[Out]

1/10*sqrt(5)*(pi*sgn(x) + 2*arctan(1/5*sqrt(5)*(x^2 - 1)/x))

Mupad [B] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.59 \[ \int \frac {1+x^2}{1+3 x^2+x^4} \, dx=\frac {\sqrt {5}\,\left (\mathrm {atan}\left (\frac {\sqrt {5}\,x^3}{5}+\frac {4\,\sqrt {5}\,x}{5}\right )+\mathrm {atan}\left (\frac {\sqrt {5}\,x}{5}\right )\right )}{5} \]

[In]

int((x^2 + 1)/(3*x^2 + x^4 + 1),x)

[Out]

(5^(1/2)*(atan((4*5^(1/2)*x)/5 + (5^(1/2)*x^3)/5) + atan((5^(1/2)*x)/5)))/5